home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / telnet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-13  |  1.4 KB  |  54 lines

  1. #ifndef    _TELNET_H
  2. #define    _TELNET_H
  3.  
  4. #ifndef _SESSION_H
  5. #include "session.h"
  6. #endif
  7.  
  8. #define    LINESIZE    256    /* Length of local editing buffer */
  9.  
  10. /* Telnet command characters */
  11. #define    IAC        255    /* Interpret as command */
  12. #define    WILL        251
  13. #define    WONT        252
  14. #define    DO        253
  15. #define    DONT        254
  16. #define CLEARSCREEN     250
  17. #define CLEARSPLIT      249
  18. #define COMPRESSED    248
  19.  
  20. /* Telnet options */
  21. #define    TN_TRANSMIT_BINARY    0
  22. #define    TN_ECHO            1
  23. #define    TN_SUPPRESS_GA        3
  24. #define    TN_STATUS        5
  25. #define    TN_TIMING_MARK        6
  26. #define    NOPTIONS        6
  27.  
  28. /* Telnet protocol control block */
  29. struct telnet {
  30.     char local[NOPTIONS];    /* Local option settings */
  31.     char remote[NOPTIONS];    /* Remote option settings */
  32.     struct session *session;    /* Pointer to session structure */
  33.     char eolmode;        /* Control translation of enter key */
  34. };
  35. #define    NULLTN    (struct telnet *)0
  36.  
  37. extern int Refuse_echo;
  38. extern int Tn_cr_mode;
  39.  
  40. /* In telnet.c: */
  41. int tel_connect __ARGS((struct session *sp,char *fsocket,int len));
  42. void tel_output __ARGS((int unused,void *p1,void *p2));
  43. void tnrecv __ARGS((struct telnet *tn));
  44. void doopt __ARGS((struct telnet *tn,int opt));
  45. void dontopt __ARGS((struct telnet *tn,int opt));
  46. void willopt __ARGS((struct telnet *tn,int opt));
  47. void wontopt __ARGS((struct telnet *tn,int opt));
  48. void answer __ARGS((struct telnet *tn,int r1,int r2));
  49.  
  50. /* In ttylink.c: */
  51. void ttylhandle __ARGS((int s,void *unused,void *p));
  52.  
  53. #endif    /* _TELNET_H */
  54.